/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.alien.admin.modules.deploy.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.sql.Timestamp;

/**
* @website https://el-admin.vip
* @description /
* @author zengzhifang
* @date 2021-09-09
**/
@Entity
@Data
@Table(name="dp_server")
public class DpServer implements Serializable {

    @Id
    @Column(name = "project_id")
    @ApiModelProperty(value = "项目id")
    private Long projectId;

    @Column(name = "name")
    @ApiModelProperty(value = "项目名称")
    private String name;

    @Column(name = "code_type")
    @ApiModelProperty(value = "代码类型")
    private String codeType;

    @Column(name = "description")
    @ApiModelProperty(value = "项目描述")
    private String description;

    @Column(name = "http_url")
    @ApiModelProperty(value = "仓库http地址")
    private String httpUrl;

    @Column(name = "ssh_url")
    @ApiModelProperty(value = "仓库ssh地址")
    private String sshUrl;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建日期")
    private Timestamp createTime;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;


    public void copy(DpServer source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
